/**
 * @see [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/api/wxml-nodes-info.html#nodesrefscrolloffsetcallback)
 */

export default function scroll_offset(nodes_ref: wx.NodesRef) {
	return new Promise<{
		id: string;			// 节点的ID
		dataset: any;		// 节点的dataset
		scrollLeft: number;	// 节点的水平滚动位置
		scrollTop: number;	// 节点的竖直滚动位置
	}>((resolve) => {
		nodes_ref.scrollOffset((res) => {
			resolve(res);
		}).exec();
	});
}
